package tg.game.lottery.crawler;

import java.sql.Timestamp;

import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Table;

/**
 * 游戏开奖表
 * @author NKW
 * 每次刷完，放内存来对比，有更新就用新的
 * 
 * 不同家的api都要解析出此记录，如果已经有存在的，主要是为了开奖时间和开奖内容要放在自己相应的位置上
 * 
 * 不同家的游戏id是不一样的，所以要想办法 转化成本地一样的，绑定到本地id来
 * 
 * 抓奖任务： 
 *    指定网址，指定本网的游戏id和本地游戏id对应表，指定抓的间隔，指定解析器
 *    抓到奖丢给解析器
 *    然后返回
 *    
 *    
 *    抓单个，抓多个
 *    
 */
@Table("t_game_lottery")
public class GameLottery {
	@Id
	private int id;//自增id
	private String gid;//游戏id
	private String round_id;//场次期数id
	
	private Timestamp  open_time1;//开奖1的时间（源时间）
	private Timestamp  record_time1;//开奖1的记录时间（本地抓到的时间）
	private String lottery1;//开奖1内容
	

	private Timestamp  open_time2;//开奖2的时间（源时间）
	private Timestamp  record_time2;//开奖2的记录时间（本地抓到的时间）
	private String lottery2;//开奖2内容
	

	private Timestamp  open_time3;//开奖3的时间（源时间）
	private Timestamp  record_time3;//开奖3的记录时间（本地抓到的时间）
	private String lottery3;//开奖3内容
	
	private Timestamp create_time;//创建时间（也是第一个开奖的创建时间）

	public String getGid() {
		return gid;
	}

	public void setGid(String gid) {
		this.gid = gid;
	}

	public String getRound_id() {
		return round_id;
	}

	public void setRound_id(String round_id) {
		this.round_id = round_id;
	}

	public Timestamp getOpen_time1() {
		return open_time1;
	}

	public void setOpen_time1(Timestamp open_time1) {
		this.open_time1 = open_time1;
	}

	public Timestamp getRecord_time1() {
		return record_time1;
	}

	public void setRecord_time1(Timestamp record_time1) {
		this.record_time1 = record_time1;
	}

	public String getLottery1() {
		return lottery1;
	}

	public void setLottery1(String lottery1) {
		this.lottery1 = lottery1;
	}

	public Timestamp getOpen_time2() {
		return open_time2;
	}

	public void setOpen_time2(Timestamp open_time2) {
		this.open_time2 = open_time2;
	}

	public Timestamp getRecord_time2() {
		return record_time2;
	}

	public void setRecord_time2(Timestamp record_time2) {
		this.record_time2 = record_time2;
	}

	public String getLottery2() {
		return lottery2;
	}

	public void setLottery2(String lottery2) {
		this.lottery2 = lottery2;
	}

	public Timestamp getOpen_time3() {
		return open_time3;
	}

	public void setOpen_time3(Timestamp open_time3) {
		this.open_time3 = open_time3;
	}

	public Timestamp getRecord_time3() {
		return record_time3;
	}

	public void setRecord_time3(Timestamp record_time3) {
		this.record_time3 = record_time3;
	}

	public String getLottery3() {
		return lottery3;
	}

	public void setLottery3(String lottery3) {
		this.lottery3 = lottery3;
	}

	public Timestamp getCreate_time() {
		return create_time;
	}

	public void setCreate_time(Timestamp create_time) {
		this.create_time = create_time;
	}

	public int getId() {
		return id;
	}
	
	///-------------------------------------------------------------------------------------------------------

	public String getLottery(int id) {
		switch (id) {
			case 1:
				return lottery1;
			case 2:
				return lottery2;
			case 3:
				return lottery3;
			default:
				break;
		}
		return null;
	}

	public void setLottery(String lottery,int id) {
		switch (id) {
			case 1:
				this.lottery1 = lottery;
				break;
			case 2:
				this.lottery2 = lottery;
				break;
			case 3:
				this.lottery3 = lottery;
				break;
			default:
				break;
		}
	}

	public Timestamp getOpen_time(int id) {
		switch (id) {
			case 1:
				return open_time1;
			case 2:
				return open_time2;
			case 3:
				return open_time3;
			default:
				break;
		}
		return null;
	}

	public void setOpen_time(Timestamp open_time,int id) {
		switch (id) {
			case 1:
				this.open_time1 = open_time;
				break;
			case 2:
				this.open_time2 = open_time;
				break;
			case 3:
				this.open_time3 = open_time;
				break;
			default:
				break;
		}
	}

	public Timestamp getRecord_time(int id) {
		switch (id) {
			case 1:
				return record_time1;
			case 2:
				return record_time2;
			case 3:
				return record_time3;
			default:
				break;
		}
		return null;
	}

	public void setRecord_time(Timestamp record_time,int id) {
		switch (id) {
		case 1:
			this.record_time1 = record_time;
			break;
		case 2:
			this.record_time2 = record_time;
			break;
		case 3:
			this.record_time3 = record_time;
			break;
		default:
			break;
	}
	}
}
